package test.n00000;

public class Problem00082 {
    public static void main(String[] args) {
        println(123);
    }

    public static void println(final int x) {
        Solution ss = new Solution();
        System.out.println(x + "," + ss.isPalindrome(x));
    }

    public static class Solution {

        /**
         * 回文数, 顺序和逆序值相等
         *
         * @param x
         * @return
         */
        public boolean isPalindrome(int x) {
            if (x < 0) {
                return false;
            }
            if (x < 10) {
                return true;
            }

            int r = 0;
            int s = x;

            while(s > 0) {
                r = r * 10 + s % 10;
                s = s / 10;
            }

            return r == x;
        }
    }
}
